Skip to content

fix(Vue): nullish params in useLiveQueryImpl#466

Merged
samwillis merged 5 commits intoelectric-sql:mainfrom
sandros94:fix-vue-live-nullish-params
Jan 13, 2025
Merged

fix(Vue): nullish params in useLiveQueryImpl#466
samwillis merged 5 commits intoelectric-sql:mainfrom
sandros94:fix-vue-live-nullish-params

Conversation

@sandros94
Copy link
Contributor

Fixes a small oversight on useLiveQuery and useLiveIncrementalQuery when params are nullish.

Eg. if we want to go brrr and subscribe to all updates to a particular table like:

<script setup lang="ts">
const items = useLiveQuery('SELECT * FROM my_table;')
</script>

@sandros94 sandros94 changed the title fix(Vue): nullish params fix(Vue): nullish params in useLiveQueryImpl Dec 11, 2024
@yacineb
Copy link
Contributor

yacineb commented Dec 12, 2024

@samwillis this PR typically fixes #448

@sandros94
Copy link
Contributor Author

Indeed, thank you @yacineb 🙏

@sandros94
Copy link
Contributor Author

sandros94 commented Dec 12, 2024

marked as draft because I think I could improve it further

@sandros94 sandros94 marked this pull request as ready for review December 12, 2024 12:09
@sandros94
Copy link
Contributor Author

sandros94 commented Dec 12, 2024

These latest changes both makes sure that the watcher receives an array of refs as well as returning getters values if params is an array. Also reduced the amount of if checks

Copy link
Collaborator

@samwillis samwillis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @sandros94, this is great. I added a changeset, a test and fixed some formatting in your branch. Going to merge now 🥳

@samwillis samwillis merged commit 7ce9f04 into electric-sql:main Jan 13, 2025
7 checks passed
@sandros94 sandros94 deleted the fix-vue-live-nullish-params branch January 13, 2025 20:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants